package com.apop.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * 文件上传配置
 * @author Youhai Yan
 * @version V1.0
 * @ClassName ConfigBean
 * @date 2021/12/9 9:00
 * @Description:
 */

@Configuration
public class FileUploadConfig {
    @Bean
    public CommonsMultipartResolver multipartResolver(){
        CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
        multipartResolver.setDefaultEncoding("UTF-8");
        multipartResolver.setMaxUploadSize(104857600);
        multipartResolver.setMaxInMemorySize(40960);
        return multipartResolver;
    }
}
